package com.xzbd.gef.palette;


import java.util.ArrayList;
import java.util.List;

public class MyPaletteDrawer {
	private String name;

	private List<MyPaletteDrawerItem> paletteDrawerItems;

	public MyPaletteDrawer(String name) {
		this.name = name;
		this.paletteDrawerItems = new ArrayList<MyPaletteDrawerItem>();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<MyPaletteDrawerItem> getPaletteDrawerItems() {
		return paletteDrawerItems;
	}

	public void setPaletteDrawerItems(List<MyPaletteDrawerItem> paletteDrawerItems) {
		this.paletteDrawerItems = paletteDrawerItems;
	}

	public MyPaletteDrawer build(String name) {
		new MyPaletteDrawer(name);
		return this;
	}

	public MyPaletteDrawer add(MyPaletteDrawerItem item) {
		this.getPaletteDrawerItems().add(item);
		return this;
	}
	
	public MyPaletteDrawer add(String label, String shortDesc, Class<?> factoryClass, String iconSmall,
			String iconLarge) {
		this.add(MyPaletteDrawerItem.of(label, shortDesc, factoryClass, iconSmall, iconLarge));
		return this;
	}

}
